package com.meida.student.app.user.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.SaveInterceptor;
import com.meida.common.mybatis.query.CriteriaSave;
import com.meida.common.security.OpenHelper;
import com.meida.module.bus.client.entity.BusSubject;
import com.meida.module.user.client.entity.AppUser;
import org.springframework.stereotype.Component;

/**
 * app用户添加知识点
 *
 * @author zyf
 */
@Component
public class SubjectSaveHandler implements SaveInterceptor<BusSubject> {


    @Override
    public void prepare(CriteriaSave criteriaSave, EntityMap entityMap, BusSubject busSubject) {
        busSubject.setUserType(AppUser.class.getSimpleName());
        busSubject.setUserId(OpenHelper.getUserId());
    }
}
